package com.guanyong.model;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by mxk on 2017/9/19.
 */
public class KeyFilmModel {
    private  String curDate;
    private  String curDateStr;
    private  String sliceRatio;
    private  String personNum;

    public String getCurDate() {
        return curDate;
    }

    public void setCurDate(String curDate) {
        this.curDate = curDate;
    }

    public String getCurDateStr() {
        return curDateStr;
    }

    public void setCurDateStr(String firtPlay) {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        Date from = null;
        Date to = null;
        SimpleDateFormat dateFm = new SimpleDateFormat("EEEE");
        String week=null;
        try {
            week =dateFm.format(df.parse(this.curDate));
            from = df.parse(firtPlay);
            to = df.parse(this.curDate);
        } catch (ParseException e) {
            e.printStackTrace();
        }
        int days = (int) (to.getTime() - from.getTime())
                / (24 * 60 * 60 * 1000)+1;

        if (days==0){
            week+=" 上映首日";
        }else if (days<0){
            week+=" 未上映";
        }
        else {
            week+=" 上映"+days+"天";
        }
        this.curDateStr = week;
    }

    public String getSliceRatio() {
        return sliceRatio;
    }

    public void setSliceRatio(String sliceRatio) {
        this.sliceRatio = sliceRatio;
    }

    public String getPersonNum() {
        return personNum;
    }

    public void setPersonNum(String personNum) {
        this.personNum = personNum;
    }
}
